ga.core.individual
Class IndividualComparator.TestInterval

java.lang.Object
  extended by ga.core.individual.IndividualComparator.TestInterval
All Implemented Interfaces:
IFitness, IIndividual<IndividualComparator.TestInterval>, IIntervalFitness, java.lang.Cloneable
Enclosing class:
IndividualComparator<T extends IIndividual<T>>

private static class IndividualComparator.TestInterval
extends java.lang.Object
implements IIntervalFitness, IIndividual<IndividualComparator.TestInterval>

This class is just for testing.

Since:
11.08.2012
Author:
Stephan Dreyer

Field Summary
private  double center
           
private  double max
           
private  double min
           
private  java.lang.String name
           
 
Fields inherited from interface ga.core.individual.IFitness
UNEVALUATED
 
Constructor Summary
IndividualComparator.TestInterval(java.lang.String name)
           
 
Method Summary
 IndividualComparator.TestInterval clone()
          Creates a new individual that is equal to this.
 GAContext getContext()
          Getter for the GA context.
 double getFitness()
          Getter for the fitness of the individual.
 double getFitnessWidth()
          Getter for the fitness width (max-min).
 long getId()
          Getter for the unique id.
 double getMaxFitness()
          Getter for the maximum fitness.
 double getMinFitness()
          Getter for the minimum fitness.
 void initRandomly()
          Initializes the genotype randomly and resets the fitness.
 boolean isEvaluated()
          Determines if the individual has been evaluated.
 void setContext(GAContext context)
          Sets the GA context.
 void setFitness(double fitness)
          Setter for the fitness of the individual.
 void setFitnessInterval(double center, double width)
          Sets the fitness interval by its center and width.
 void setFitnessLimits(double min, double max)
          Sets the fitness interval by its minimum and maximum.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

min

private double min

max

private double max

center

private double center

name

private final java.lang.String name
Constructor Detail

IndividualComparator.TestInterval

public IndividualComparator.TestInterval(java.lang.String name)
Parameters:
name - name
Since:
11.08.2012
Method Detail

setFitness

public void setFitness(double fitness)
Description copied from interface: IFitness
Setter for the fitness of the individual.

Specified by:
setFitness in interface IFitness
Parameters:
fitness - The fitness.

getFitness

public double getFitness()
Description copied from interface: IFitness
Getter for the fitness of the individual.

Specified by:
getFitness in interface IFitness
Returns:
The fitness.

getMinFitness

public double getMinFitness()
Description copied from interface: IIntervalFitness
Getter for the minimum fitness.

Specified by:
getMinFitness in interface IIntervalFitness
Returns:
The min fitness.

getMaxFitness

public double getMaxFitness()
Description copied from interface: IIntervalFitness
Getter for the maximum fitness.

Specified by:
getMaxFitness in interface IIntervalFitness
Returns:
The max fitness.

getFitnessWidth

public double getFitnessWidth()
Description copied from interface: IIntervalFitness
Getter for the fitness width (max-min).

Specified by:
getFitnessWidth in interface IIntervalFitness
Returns:
The width.

setFitnessInterval

public void setFitnessInterval(double center,
                               double width)
Description copied from interface: IIntervalFitness
Sets the fitness interval by its center and width.

Specified by:
setFitnessInterval in interface IIntervalFitness
Parameters:
center - Center of the fitness interval.
width - The width of the fitness interval.

setFitnessLimits

public void setFitnessLimits(double min,
                             double max)
Description copied from interface: IIntervalFitness
Sets the fitness interval by its minimum and maximum.

Specified by:
setFitnessLimits in interface IIntervalFitness
Parameters:
min - Minimum fitness.
max - Maximum fitness.

initRandomly

public void initRandomly()
Description copied from interface: IIndividual
Initializes the genotype randomly and resets the fitness.

Specified by:
initRandomly in interface IIndividual<IndividualComparator.TestInterval>

isEvaluated

public boolean isEvaluated()
Description copied from interface: IIndividual
Determines if the individual has been evaluated.

Specified by:
isEvaluated in interface IIndividual<IndividualComparator.TestInterval>
Returns:
true if the individual is evaluated.

getId

public long getId()
Description copied from interface: IIndividual
Getter for the unique id.

Specified by:
getId in interface IIndividual<IndividualComparator.TestInterval>
Returns:
The id.

setContext

public void setContext(GAContext context)
Description copied from interface: IIndividual
Sets the GA context.

Specified by:
setContext in interface IIndividual<IndividualComparator.TestInterval>
Parameters:
context - The context

getContext

public GAContext getContext()
Description copied from interface: IIndividual
Getter for the GA context.

Specified by:
getContext in interface IIndividual<IndividualComparator.TestInterval>
Returns:
context The context

clone

public IndividualComparator.TestInterval clone()
Description copied from interface: IIndividual
Creates a new individual that is equal to this.

Specified by:
clone in interface IIndividual<IndividualComparator.TestInterval>
Overrides:
clone in class java.lang.Object
Returns:
The clone.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object